package com.boot.system.entity.listener;

import com.boot.system.entity.SysMenu;
import com.mybatisflex.annotation.SetListener;

public class MenuOnSetListener implements SetListener {
    @Override
    public Object onSet(Object entity, String property, Object value) {
        SysMenu sysMenu = (SysMenu) entity;
        if (property.equals("roles") && value != null){
            sysMenu.setRoleArr(value.toString().split(","));
        }
        return value;
    }
}
